/*
 * Copyright 2008-2023 dexian.vip. All rights reserved.
 * Support: http://www.dexian.vip
 * License: http://www.dexian.vip/license
 */

package vip.dexian.admin.controller;

import vip.dexian.admin.base.BaseController;
import vip.dexian.admin.service.CaptchaService;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;


/**
 * 验证码controller
 *
 * @author 挺好的 2023年06月05日 15:57
 */
@Controller ("captchaController")
@RequestMapping ("/captcha")
@Slf4j
public class CaptchaController extends BaseController {

    /**
     * 验证码
     */
    @Resource (name = "captchaServiceImpl")
    private CaptchaService captchaService;

    /**
     * 输入验证码
     *
     * @param request
     *         {@link jakarta.servlet.http.HttpServletRequest}
     * @param response
     *         {@link jakarta.servlet.http.HttpServletResponse}
     */
    @GetMapping
    public void captcha (HttpServletRequest request, HttpServletResponse response) {
        this.captchaService.create(request, response);
    }
}
